﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace aula14
{
    public class Stack<T>
    {
        int position;
        T[] data = new T[100];

        public void Push(T obj) 
        { 
            data[position++] = obj; 
        }
        public T Pop()
        {
            return data[--position];
        }

    }
    public class Principal
    {
        public static void Main()
        {
            Stack<int> stack = new Stack<int>();
            stack.Push(5);
            stack.Push(19);
            int x = stack.Pop();
            int y = stack.Pop();
            Console.WriteLine("Ultimo Numero Colocado = " + x);
            Console.WriteLine("Penultimo Numero Colocado = " + y);
            Console.ReadLine();

        }
    }
}
